
#ifndef OCTAVEUTILS_H

#include <gsl/gsl_matrix.h>
#include <gsl/gsl_vector.h>
#include <octave/oct.h>

/// Implements utility methods for interaction between Octave and GSL.
class OctaveUtils
{
 public:
  /// Converts a gsl_matrix to Matrix (the GNU Octave matrix class).
  /**
   * This method copies the contents an existing gsl_matrix 
   * to a new Matrix and returns a copy of it.
   */
  static Matrix GSLMatrixToOctaveMatrix(const gsl_matrix *M);
  
  /// Converts a gsl_vector to ColumnVector (the GNU Octave vector class).
  /**
   * This method copies the contents an existing gsl_vector 
   * to a new ColumnVector and returns a copy of it.
   */
  static ColumnVector GSLVectorToOctaveVector(const gsl_vector *v);

  /// Converts a ColumnVector to gsl_vector.
  /**
   * This method copies the contents an existing ColumnVector 
   * to a new gsl_vector and returns a pointer to the newly 
   * allocated instance.
   */
  static gsl_vector *OctaveVectorToGSLVector(const ColumnVector &v);
};

#define OCTAVEUTILS_H

#endif
